<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>倒计时示例</title>
    <style>
        #countdown {
            font-size: 24px;
            font-weight: bold;
            text-align: center;
            margin-top: 50px;
            color: red;
        }
    </style>
</head>

<body>
    <div id="countdown"></div>

    <script>
        // 设置倒计时时间为60秒
        let countdownTime = 1 * 60 * 60 + 20 * 60 + 30;

        // 获取显示倒计时的元素
        let countdownElement = document.getElementById('countdown');

        // 更新倒计时函数
        function updateCountdown() {
            if (countdownTime > 0) {
                countdownTime--;
                let hours = Math.floor(countdownTime / 3600);
                let minutes = Math.floor((countdownTime % 3600) / 60);
                let seconds = countdownTime % 60;
                countdownElement.innerText = "离考试结束还有 " + hours + " 小时 " + minutes + " 分 " + seconds + " 秒";
            } else {
                clearInterval(timer);
                countdownElement.innerText = "考试结束！";
            }
        }

        // 每秒更新一次倒计时
        let timer = setInterval(updateCountdown, 1000);
    </script>
</body>

</html>